package com.jic.order.controller.manage;

import com.jic.common.base.vo.PageResult;
import com.jic.common.base.vo.RestResult;
import com.jic.order.manage.request.OrderBaleRequest;
import com.jic.order.manage.response.OrderBaleResponse;
import com.jic.order.service.OrderBaleService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * Created by HeJun on 2020/2/29
 *
 * @Description:
 */
@Api(tags = "包裹列表")
@RestController
@RequestMapping("/orderBale")
@Slf4j
public class OrderBaleController {

    @Autowired
    OrderBaleService orderBaleService;

    @ApiOperation(value = "获取包裹列表信息")
    @PostMapping("/queryPage")
    @ResponseBody
    public RestResult<PageResult<OrderBaleResponse>> queryPage(@RequestBody OrderBaleRequest obr) {
        return RestResult.success(orderBaleService.queryPage(obr));
    }

    @ApiOperation(value = "修改包裹列表信息")
    @PostMapping("/update")
    @ResponseBody
    public RestResult<Long> update() {
        return RestResult.success(orderBaleService.update());
    }

    @ApiOperation(value = "合并订单")
    @PostMapping("/merge")
    @ResponseBody
    public RestResult<Long> merge(@RequestBody OrderBaleRequest obr) {
        return RestResult.success(orderBaleService.merge(obr));
    }
}

